home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / Manuels & Misc / Assembly / AOA.ZIP / CH06 / EX6_7.IBM < prev    next >
Encoding:
Text File  |  1996-02-04  |  904 b   |  62 lines

  1. ; IBML Sample program #7.
  2. ; A comparison of register-register
  3. ; moves with register-memory moves
  4.  
  5. #data
  6. i        word    ?
  7. j        word    ?
  8. k        word    ?
  9. l        word    ?
  10. #enddata
  11.  
  12. #repetitions 300000
  13. #unravel 128
  14.  
  15. ; The following check checks to see how
  16. ; long it takes to multiply two values
  17. ; using the IMUL instruction.
  18.  
  19. #code ("Register-Register moves, no Hazards")
  20. %do
  21.         mov    bx, ax
  22.         mov    cx, ax
  23.         mov    dx, ax
  24.         mov    si, ax
  25.         mov    di, ax
  26.         mov    bp, ax
  27. #endcode
  28.  
  29. #code ("Register-Register moves, with Hazards")
  30. %do
  31.         mov    bx, ax
  32.         mov    cx, bx
  33.         mov    dx, cx
  34.         mov    si, dx
  35.         mov    di, si
  36.         mov    bp, di
  37. #endcode
  38.  
  39. #code ("Memory-Register moves, no Hazards")
  40. %do
  41.         mov    ax, i
  42.         mov    bx, j
  43.         mov    cx, k
  44.         mov    dx, l
  45.         mov    ax, i
  46.         mov    bx, j
  47. #endcode
  48.  
  49. #code ("Register-Memory moves, no Hazards")
  50. %do
  51.         mov    i, ax
  52.         mov    j, bx
  53.         mov    k, cx
  54.         mov    l, dx
  55.         mov    i, ax
  56.         mov    j, bx
  57. #endcode
  58.  
  59.  
  60.  
  61. #end
  62.